package org.neuedu.fly.mapper;

import org.apache.ibatis.annotations.Param;
import org.neuedu.fly.entity.Post;

import java.util.List;

public interface PostMapper {
    List<Post> page(@Param("pageIndex") int pageIndex,
                    @Param("pageSize") int pageSize);

    List<Post> indexPage(@Param("pageIndex") int pageIndex,
                         @Param("pageSize") int pageSize,
                         @Param("isClosed") int isClosed,
                         @Param("isFine") int isFine,
                         @Param("isTop") int isTop,
                         @Param("columnName") String columnName);

    int count(@Param("isClosed") int isClosed,
              @Param("isFine") int isFine,
              @Param("isTop") int isTop,
              @Param("columnName") String columnName);

    long userCount(int userId);

    List<Post> hotPost();

    boolean del(int uId);
    boolean delByPostId(int postId);

    boolean sendPost(Post post);

    Post findReplyByPostId(int postId);

    List<Post> findPostByUserId(@Param("userId") int userId,
                                @Param("pageIndex") int pageIndex,
                                @Param("pageSize") int pageSize);

    boolean edit(@Param("id") int id,
                 @Param("isStatus") int isStatus,
                 @Param("isTop") int isTop,
                 @Param("isFine") int isFine);
}
